<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="产品详情  "></u-navbar> -->
		<view style=" background-color:#EFEDE9;">
			<view class="pl-2 pr-2 font-14 lineHight-40 font-weight-bold">产品信息</view>
		</view>
		<u-field v-model="newlist.productName" :border-bottom="false" label="产品名称" :disabled="true" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.productTypeName" :border-bottom="false" label="产品品类" :disabled="true"
			input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="productDetails " :border-bottom="false" :disabled="true"
			label="产品数量" input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.enterpriseName" :border-bottom="false" :disabled="true" label="企业名称"
			input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.productStartTime" :border-bottom="false" :disabled="true" label-width="240"
			label="产品季节开始日期" input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.productEndTime" :border-bottom="false" :disabled="true" label-width="240"
			label="产品季节结束日期" input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.baseName" :border-bottom="false" :disabled="true" label="基地名称" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.baseAddress" :border-bottom="false" :disabled="true" label="基地地址" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.baseContacts" :border-bottom="false" :disabled="true" label="联系人" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.basePhone" :border-bottom="false" :disabled="true" label="联系电话" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<view style=" background-color:#EFEDE9;">
			<view class="pl-2 pr-2 font-14 lineHight-40 font-weight-bold">上/下架状态</view>
		</view>
		
		<u-field :value="newlist.productStatus === '0' ? '下架' : '上架'" :border-bottom="false" :disabled="true"
			label-width="160" label="上/下架状态" input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.updateTime" :border-bottom="false" :disabled="true" label="添加时间" input-align="right"
			:field-style="placeholderStyle"></u-field>


	</view>
</template>

<script>
	import $H from '@/common/free-lib/request.js';
	import freeListItem from "@/components/free-ui/free-list-item.vue";
	import ferrButton from "@/components/free-ui/ferr-button.vue";
	export default {
		components: {
			freeListItem,
			ferrButton,
		},
		data() {
			return {

				newlist: {},
				placeholderStyle: {
					color: '#999'
				}
			}
		},
		computed: {
			productDetails() {
				return `${this.newlist.productNumber || ''} ${this.newlist.productSpecs || ''}`.trim();
			}
		},
		onLoad(options) {
			const id = options.id;
			this.NewListDetail(id)
		},
		methods: {
			NewListDetail(id) {
				$H.get('/agriculture/productInform/queryById', {
					id: id
				}, {}).then(res => {
					this.newlist = res.result
				}).catch(error => {
					uni.showToast({
						title: "网络错误，请稍后再试",
						icon: 'none'
					});
				});
			},

		}
	}
</script>

<style>
</style>